This study will employ a multi-center, phase II/III, double-blind randomized, placebo-controlled design. Patients with HIV infection and oral and/or esophageal aphthous ulcers of more than two weeks duration will be entered. Patients will be randomized to receive a 4 week course of either 200 mg thalidomide or placebo orally once daily.